package com.admin.controller;


import com.admin.entity.Address;
import com.admin.service.IAddressService;
import com.bean.ResponseBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author marisheng
 * @since 2019-11-21
 */
@RestController
@RequestMapping("/admin/address")
public class AddressController {

    @Autowired
    private IAddressService iAddressService;

    /**
     * 根据地址id查详细地址
     * @param id
     * @return
     */
    @RequestMapping("/selectAddress")
    public ResponseBean getAddress(int id){
        Address address=iAddressService.getById(id);
        int code=address!=null?200:500;
        return new ResponseBean(code,null,address);
    }
}
